{{--{!!  Form::model($videos, array('route' => array('videos.update', $videos->id),'method'=>'PUT'))  !!}--}}

<div class="form-group">
    {!!  Form::label('title', '标题', ['class'=>'text-danger col-sm-2 control-label'])     !!}
    <div class="col-sm-6">
        {!!  Form::text('title', null,['class'=>'form-control']) !!}
    </div>
</div>
<div class="form-group has-danger">
    {!!  Form::label('key_word', 'SEO:关键字', ['class'=>'text-danger col-sm-2 control-label'])     !!}
    <div class="col-sm-6">

        {!!  Form::text('key_word',null,['class'=>'form-control','placeholder'=>'可以多个关键词以空格分隔']) !!}
    </div>
    <p class="help-block col-sm-4">必选是中文关键字,单词太短的关键字会导致关联结果过多</p>

</div>
<div class="form-group has-danger">
    {!!  Form::label('description', '简介',['class'=>'text-danger col-sm-2 control-label'])     !!}
    <div class="col-sm-6">

        {!!  Form::textarea('description',null,['class'=>'form-control','placeholder'=>'可以多个关键词以空格分隔','rows'=>4]) !!}
    </div>
    <p class="help-block col-sm-4">必填:SEO描述</p>

</div>
<hr>
<div class="form-group has-success">
    {!!  Form::label('video_title', '视频的标题',['class'=>'text-danger col-sm-2 control-label'])     !!}
    <div class="col-sm-6">
        {!!  Form::text('video_title',null,['class'=>'form-control','placeholder'=>'视频的标题']) !!}
    </div>
    <p class="help-block col-sm-4">视频的标题</p>
</div>
<div class="form-group has-success">
    {!!  Form::label('url_video', '视频源地址',['class'=>'text-danger col-sm-2 control-label'])     !!}
    <div class="col-sm-6">
        {!!  Form::text('url_video',null,['class'=>'form-control','placeholder'=>'http://']) !!}
    </div>
    <p class="help-block col-sm-4">支持:微博/秒拍/微博 无广告播放</p>
</div>
<hr>

<div class="form-group has-danger">
    {!!  Form::label('tag_list', '标签TAG', ['class'=>'text-danger col-sm-2 control-label'])  !!}
    <div class="col-sm-6">
        {!!  Form::select('tag_list[]',$tags,null,['class'=>'form-control','id'=>'tag_list','multiple'=>'multiple']) !!}
    </div>
    <p class="help-block col-sm-4">方便不同文章进行聚合,方便seo</p>
</div>
{{--http://select2.github.io/examples.html--}}
<div class="form-group">
    {!!  Form::label('show_list', '美剧SHOW', ['class'=>'text-danger col-sm-2 control-label'])  !!}
    <div class="col-sm-6">
        {!!  Form::select('show_list[]',$shows,null,['class'=>'form-control','id'=>'show_list','multiple'=>'multiple']) !!}
    </div>
    <p class="help-block col-sm-4">请选择对应的美剧</p>
</div>
<div class="form-group">
    {!!  Form::label('movie_list', '电影MOVIE',['class'=>'text-danger col-sm-2 control-label'])  !!}
    <div class="col-sm-6">
        {!!  Form::select('movie_list[]',$movies,null,['class'=>'form-control','id'=>'movie_list','multiple'=>'multiple']) !!}
    </div>
    <p class="help-block col-sm-4">请选择对应的电影</p>
</div>

<div class="form-group">
    {!!  Form::label('body', '正文', ['class'=>'text-danger col-sm-2 control-label'])     !!}
    <script id="container" name="body" type="text/plain" class="col-sm-10">
        {!! $article->body !!}
    </script>

    <!-- 配置文件 -->
    <script type="text/javascript" src="/ueditor/ueditor.config.js"></script>
    <!-- 编辑器源码文件 -->
    <script type="text/javascript" src="/ueditor/ueditor.all.js"></script>
    <!-- 实例化编辑器 -->
    <script type="text/javascript">
        var imagesJson = {!! $article->images !!};
        var editor = UE.getEditor('container');
        //自定义
        //http://fex.baidu.com/ueditor/#qa-customurl
        UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
        UE.Editor.prototype.getActionUrl = function (action) {
            if (action == 'listimage') {
                //图片列表
                return '/ueditor/listimage';
            } else if (action == 'uploadimage') {
                //上传图片
                return '/ueditor/uploadimage';
            } else if (action == 'uploadscrawl') {
                return '/ueditor/uploadscrawl';
            } else if (action == 'catchimage') {
                return '/ueditor/catchimage';
            } else if (action == 'imageSearch') {
                return '/ueditor/imageSearch';
            } else {
                return this._bkGetActionUrl.call(this, action);
            }
        }
        //发送附加的文章参数
        editor.ready(function () {
            editor.execCommand('serverparam', 'article_id', '{{$article->id}}');
            //获取html内容，返回: <p>hello</p>
            var hmtlDome = $("<div class='article-body'>" + editor.getContent() + "</div>");

            //使用jq净化抓取的文章
            hmtlDome.find('img').each(function (idx, ele) {
                $(ele).addClass('img-thumbnail w-100').removeProp('style').removeProp('height').removeProp('width');
                //精华image
                imagesJson.forEach(function (obj) {
                    if ($(ele).attr('src') == obj.fname) {
                        $(ele).attr('src', obj.url)


                    }
                })

            });
            bodyNode = hmtlDome.wrapAll("<div class='article-body' />")


            editor.setContent(bodyNode.html());




        });


    </script>
</div>

<div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
        {!!  Form::submit('保存',['class'=>'btn btn-success  btn-block']) !!}
    </div>
</div>
